﻿@page "/result/{ticket}"
@using Sve.Blazor.InfiniteScroll.Components

@inject IPoetryStorage _poetryStorage
@inject INavigationService _navigationService
@inject IParcelBoxService _parcelBoxService

<InfiniteScroll ObserverTargetId="observerTarget"
                ObservableTargetReached="_ => LoadMoreAsync()">
    @foreach (var poetry in _poetries) {
        <div @onclick="() => OnClick(poetry)">
            <Card>
                <BodyTemplate>
                    <span style="font-weight: bold; color: #0078d4">@poetry.Name</span>
                    <div class="shim-2xs"></div>
                    @poetry.Dynasty @poetry.Author
                    <div class="shim-2xs"></div>
                    @poetry.Content.Substring(0, @poetry.Content.IndexOf("。"))……
                </BodyTemplate>
            </Card>
        </div>
        <div class="shim-xl"></div>
    }
    <div id="observerTarget">
        @_status
    </div>
</InfiniteScroll>